﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace FluentUnity.Tests
{
    [TestClass]
    public class EnsureTests
    {
        [TestMethod]
        //[ExpectedException(typeof(ArgumentNullException))]
        public void IsNotNullException()
        {
            //Ugly hack.  Resharper test runner doesn't honor ExpectedException for 3.5 Test Projects
            try
            {
                DoSomething(null);
                throw new Exception("Expected ArgumentNullException");
            }
            catch (ArgumentNullException)
            {
            }

        }

        [TestMethod]
        public void IsNotNullValue()
        {
            DoSomething(new object());
        }

        private void DoSomething(object thing)
        {
            Ensure.IsNotNull(() => thing);
        }
    }
}
